package org.jeecg.modules.online.auth.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;
import org.jeecg.common.system.vo.SysPermissionDataRuleModel;
import org.jeecg.modules.online.auth.entity.OnlAuthData;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.online.auth.vo.AuthDataVO;

/**
 * @Description: onl_auth_data
 * @Author: jeecg-boot
 * @Date:   2020-07-16
 * @Version: V1.0
 */
public interface OnlAuthDataMapper extends BaseMapper<OnlAuthData> {


    /**
     * 根据用户ID 和 表单ID找 角色的权限信息
     * @param userId
     * @param cgformId
     * @return
     */
    List<SysPermissionDataRuleModel> queryRoleAuthData(@Param("userId") String userId,@Param("cgformId") String cgformId);

    /**
     * 根据用户ID 和 表单ID找 部门的权限信息
     * @param userId
     * @param cgformId
     * @return
     */
    List<SysPermissionDataRuleModel> queryDepartAuthData(@Param("userId") String userId,@Param("cgformId") String cgformId);

    /**
     * 根据用户ID 和 表单ID找 用户的权限信息
     * @param userId
     * @param cgformId
     * @return
     */
    List<SysPermissionDataRuleModel> queryUserAuthData(@Param("userId") String userId,@Param("cgformId") String cgformId);


   /* @Select("select id,rule_name from onl_auth_data where status = 1 and cgform_id = #{cgformId}")
    @Results({
            @Result(id = true, column = "id", property = "id", jdbcType = JdbcType.VARCHAR),
            @Result(column = "rule_name", property = "title", jdbcType = JdbcType.VARCHAR)
    })
    List<AuthDataVO> findByCondition(@Param("cgformId") String cgformId);*/

}
